package com.hehua.web.factory;

import java.util.Scanner;

public class OperationClient {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入数字");
        Double numberOne = scanner.nextDouble();
        System.out.println("输入数字");
        Double numberTwo = scanner.nextDouble();
        System.out.println("输入操作符");
        String operation = scanner.next();
        Operation obj = OperationSimpleFactory.createOperation(operation);
        obj.setNumberA(numberOne);
        obj.setNumberB(numberTwo);
        Double result = obj.getResult();
        System.out.println("计算结果" + result);
    }
}
